package cn.yyh;

import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

import cn.yyh.gateway.filter.ErrorAccessFilter;
import cn.yyh.gateway.filter.PostAccessFilter;
import cn.yyh.gateway.filter.PreAccessFilter;
import cn.yyh.gateway.filter.RoutingAccessFilter;

@EnableZuulProxy
@SpringCloudApplication
public class Application {
	public static void main(String[] args) {
		new SpringApplicationBuilder(Application.class).web(true).run(args);
	}
	@Bean
	public PreAccessFilter preAccessFilter() {
		return new PreAccessFilter();
	}
	@Bean
	public ErrorAccessFilter errorAccessFilter() {
		return new ErrorAccessFilter();
	}
	@Bean
	public PostAccessFilter postAccessFilter() {
		return new PostAccessFilter();
	}
	@Bean
	public RoutingAccessFilter routingAccessFilter() {
		return new RoutingAccessFilter();
	}
}
